//
//  STLimitHandle.m
//  CuiBoStore
//
//  Created by 崔博 on 16/12/6.
//  Copyright © 2016年 崔博. All rights reserved.
//

#import "STLimitHandle.h"
#import "STBannerModel.h"
#import "STSingleModel.h"
#import "STLimitBrandModel.h"
#import "STProductGoodsModel.h"
@implementation STLimitHandle
+ (void)excuteBannerSucess:(SucessBlock)sucess failed:(FailedBlock)failed
{
    [HttpTool postWithPath:LIMITBANNER params:nil success:^(id json) {
        NSArray *dataList = [STBannerModel mj_objectArrayWithKeyValuesArray:json];
        sucess(dataList);
    } failure:^(NSError *error) {
        failed(error);
    }];
}

+ (void)excuteSingleListSucess:(SucessBlock)sucess failed:(FailedBlock)failed
{
    [HttpTool postWithPath:LIMITSINGLE params:nil success:^(id json) {
        NSArray *dataList = [STSingleModel mj_objectArrayWithKeyValuesArray:json];
        sucess(dataList);
    } failure:^(NSError *error) {
        
    }];
}
+ (void)excuetBrandListSucess:(SucessBlock)sucess failed:(FailedBlock)failed
{
    [HttpTool postWithPath:LIMITGROUP params:nil success:^(id json) {
        
        NSArray *array = [STLimitBrandModel mj_objectArrayWithKeyValuesArray:json];
        sucess(array);
    } failure:^(NSError *error) {
        
    }];
}
+ (void)excuteSearchProductList:(NSString *)searchText sucess:(SucessBlock)sucess failed:(FailedBlock)failed
{
    NSDictionary *dic = @{@"search":searchText,
                          @"OrderName":@"host",
                          @"OrderType":@"ASC"};
    
    [HttpTool postWithPath:SEARCHPRODUCTLIST params:dic success:^(id json) {
    
        NSArray *dataList = [STProductGoodsModel mj_objectArrayWithKeyValuesArray:json];
        sucess(dataList);
    } failure:^(NSError *error) {
        
    }];
}
@end
